//
//  BaseViewController.m
//  智慧银行
//
//  Created by rimi on 15/9/28.
//  Copyright (c) 2015年 weilai. All rights reserved.
//

#import "BaseViewController.h"
#define WIDTH self.view.bounds.size.width
#define HEIGHT self.view.bounds.size.height
@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initalizeuserinterface];
}

- (void)initalizeuserinterface
{
    UISwipeGestureRecognizer *leftSwipe = [[UISwipeGestureRecognizer alloc]
                                           initWithTarget:self
                                           action:@selector(processgestureLeft)];
    leftSwipe.direction = UISwipeGestureRecognizerDirectionLeft;
    [self.view addGestureRecognizer:leftSwipe];
    
    // 右滑
    UISwipeGestureRecognizer *rightSwipe = [[UISwipeGestureRecognizer alloc]
                                            initWithTarget:self
                                            action:@selector(processgestureRight)];
    rightSwipe.direction = UISwipeGestureRecognizerDirectionRight;
    [self.view addGestureRecognizer:rightSwipe];
    
    
    _headView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 20, 100, 40)];
    [self.view addSubview:_headView];
    
    UIImageView *line = [[UIImageView alloc]initWithFrame:CGRectMake(0, 70, 768, 2)];
    line.image = [UIImage imageNamed:@"保险 横线"];
    [self.view addSubview:line];


}

- (void)processgestureLeft
{
    [UIView animateWithDuration:0.3 animations:^{
        self.view.frame = CGRectMake(70, 0, 768-70, 1024 - 20);
    }];
}

- (void)processgestureRight
{
    [UIView animateWithDuration:0.3 animations:^{
        self.view.frame = CGRectMake(170, 0, 768-70, 1024 - 20);
    }];
   
}
@end
